package ${package.Xml};

<#list table.importPackages as pkg>
import ${pkg};
</#list>
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * <p>
 * ${table.comment!}
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
public class ${entity}Dto {

    @Data
    @Accessors(chain = true)
    public static class Vo {
    <#-- ----------  BEGIN 字段循环遍历  ---------->
    <#list table.fields as field>
        <#if field.keyFlag>
            <#assign keyPropertyName="${field.propertyName}"/>
        </#if>

    <#if field.comment!?length gt 0>
    <#if swagger2>
        @ApiModelProperty(value = "${field.comment}")
    <#else>
        /**
        * ${field.comment}
        */
    </#if>
    </#if>
    <#if field.propertyType == "LocalDateTime">
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    </#if>
        private ${field.propertyType} ${field.propertyName};
    </#list>
    <#------------  END 字段循环遍历  ---------->

    <#if !entityLombokModel>
        <#list table.fields as field>
            <#if field.propertyType == "boolean">
                <#assign getprefix="is"/>
            <#else>
                <#assign getprefix="get"/>
            </#if>
            public ${field.propertyType} ${getprefix}${field.capitalName}() {
            return ${field.propertyName};
            }

            <#if chainModel>
                public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
            <#else>
                public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
            </#if>
            this.${field.propertyName} = ${field.propertyName};
            <#if chainModel>
                return this;
            </#if>
            }
        </#list>
    </#if>

    <#if entityColumnConstant>
        <#list table.fields as field>
            public static final String ${field.name?upper_case} = "${field.name}";

        </#list>
    </#if>
    <#if activeRecord>
        @Override
        protected Serializable pkVal() {
        <#if keyPropertyName??>
            return this.${keyPropertyName};
        <#else>
            return null;
        </#if>
        }

    </#if>
    <#if !entityLombokModel>
        @Override
        public String toString() {
        return "${entity}{" +
        <#list table.fields as field>
            <#if field_index==0>
                "${field.propertyName}=" + ${field.propertyName} +
            <#else>
                ", ${field.propertyName}=" + ${field.propertyName} +
            </#if>
        </#list>
        "}";
        }
    </#if>
    }

}
